segment-display
This is a driver crate for simple seven segments displays.
This crate was created for a seven-segment module made by "Qifei" marked with the serial number "3641BS". The PCB is fitted with two 74HC595 shift registers that are then connected to the 4 seven-segment displays.
The nice thing about these pcbs are that they only require 3 pins clock, data and latch to control. Another nice thing is that you can use the Spi-controller for doing this communication. The downside is that the digits are all multiplexed and therefore you have to cycle through them, update every digit in turn fast enough to fool the eye.
Right now this crate is tailored for this particular PCB and setup, but it shouldn't be too hard to modify it to support other configurations.
A simple example on how to use this driver is included below, and two other examples are available in my nucleo-f401re crate. The RTFM based one is particularly nice as it does the refresh in a RTFM scheduled task.
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate nucleo_f401re as board;
extern crate panic_semihosting;
use entry;
use Delay;
use *;
use stm32;
use ;
use Peripherals;
use SegmentDisplay;
!